package com.andy.common.extend

import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import toJson

/**
 * Author:Andy
 * Date:2023/4/27 15:30
 * Description:MapExt
 */
fun Any.toHttpBody(): RequestBody {
    return toJson().toRequestBody("application/json;charset=UTF-8".toMediaTypeOrNull())
}